
/*
 * main.c
 */

#define TARGET_GLOBAL 1

#include "Application/app.h"


/*
 * gpio0 -- 脉冲反馈
 * gpio1 -- 高电平
 * gpio2 -- 低电平
 * gpio3 -- pwm
 */

void main(void)
{
    //1. System runtime environment
	User_System_pinConfigure();
	User_System_functionConfigure();
	User_System_eventConfigure();
	User_System_initial();

	//2. Module
    //2.1 LED_Gpio
    LED_GPIO_pinConfigure();
    LED_GPIO_functionConfigure();
    LED_GPIO_eventConfigure();
	LED_GPIO_initial();



	//3. PIE runtime environment(if use interrupt)


	KEY_initial();
	KEY_pinConfigure();
	KEY_functionConfigure();
	KEY_eventConfigure();


//	MYTIMER_initial();
//	MYTIMER_pinConfigure();
//	MYTIMER_functionConfigure();
//	MYTIMER_eventConfigure();

	LED_PWM_initial();
	LED_PWM_pinConfigure();
	LED_PWM_functionConfigure();
	LED_PWM_eventConfigure();

//    MYADC_initial();
//    MYADC_pinConfigure();
//    MYADC_functionConfigure();
//    MYADC_eventConfigure();

    User_Pie_initial();
    User_Pie_pinConfigure();
    User_Pie_functionConfigure();
    User_Pie_eventConfigure();
    pwm = 0;



//	OLED_initial();
//	OLED_config();

//	MYSCI_initial();
//	MYSCI_pinConfigure();
//	MYSCI_functionConfigure();
//	MYSCI_eventConfigure();



	//4. the global interrupt start (if use interrupt)
	USER_PIE_start();

	PID_init();
	//5. main LOOP
    for( ; ; )
    {
        //PID_Concrol();
        //wShowRotate();
        myCmpA1 =30000;
        //wShowRotate();
        //myCmpA1 = 30000;
        //myCmpA1 = pwm*60000/144;
    	// call API from app.h
    //	LED_Control();
    //	LED_Control1();


   // 	myGpio->GPACLEAR=1;

       // wShowOLED4Corners();
//       myGpio->GPACLEAR = 2;
//        myGpio->GPACLEAR = 4;
//        myGpio->GPACLEAR = 8;



    }


}

